<?php
include_once 'inc/config.inc.php';
include_once 'inc/mysql.inc.php';
include_once 'inc/tool.inc.php';
$link=connect();

if(isset($_COOKIE['youyou']['name']) && isset($_COOKIE['youyou']['pw'])){
	//留言
	//转义入库
	escape($link,$_GET['view']);
	if(isset($_GET['submit3'])){

		if(empty($_GET['view'])){

			skip('contactUs.php','error','留言内容不得为空！');

		}

		$query='insert into feedback(user,username,tel,email,content,time) values("'.$_COOKIE['youyou']['name'].'","'.$_GET['username'].'","'.$_GET['tel'].'","'.$_GET['email'].'","'.$_GET['view'].'",now())';
		$result=mysqli_query($link, $query);
		if($result){
			skip('contactUs.php','ok','留言成功！感谢反馈');
		}else{
			skip('contactUs.php','error','留言失败！请稍后重试');
		}
	}
}else{
		skip('login.php','error','你还没登录，不能留言！');
}

close($link);

?>